<template>
  <div class="app">
    <Head :name="name"  :route="route"></Head>
    <swiperView :list="list"></swiperView>
    <div>
      <div class="part">
        <p class="message" @click="message"><span><van-icon name="comment-o" color="rgb(8, 98, 166)" size="28px"/>物流信息</span></p>
        <div class="complain" @click="to"> <p><van-icon name="close" color="rgb(8, 98, 166)" size="28px"/>投诉点这</p> 
          <p class="none">投了也没用</p>
        </div>
      </div>
      <div></div>
    </div>
    <div v-for="item in logisticslist" :key="item.id" class="list">
      <div class="img"><img :src="'http://124.93.196.45:10001/'+item.imgUrl" alt=""></div>
      <div class="list-right">
        <p class="name">{{item.name}}</p>
        <p class="phone"><span>{{item.phone}}</span><span class="detail" @click="detail(item.id)">查看详情》</span></p>
        
      </div>
    </div>
  </div>
</template>
<script>
import  Head  from "./logisiticsview/headView.vue"
import swiperView from "./logisiticsview/swiperView.vue";
import { swiperlist, logisticslist } from "./service"; 
export default {
  data(){
    return{
      list:[],
      logisticslist:[],
      name:'物流公司',
      route:"/logisticsComplain"
    }
  },
  components:{
    swiperView,
    Head,
  },
  async created(){
    let res = await swiperlist();
    console.log(res);
    this.list = res.data.data;
    console.log(this.list);
    let res2 = await logisticslist();
    this.logisticslist=res2.data.data
  },
  methods:{
    message(){
this.$router.push("/logisticsMessage")
    },
    to(){
  this.$router.push("/logisticsComplain")
    },
    detail(ide) {
      this.$router.push({path: "/logisticsDetail", query: {id: ide}})
    }
  }
}
</script>
<style lang="scss" scoped>
.app{
margin-bottom: 50px;
.part {
  padding: 20px;
  height: 30px;
display: flex;
justify-content: space-around;
.message{
  color: #999;
}
.complain{
  color: #999;
  .none{
    font-size: 14px;
    color: #000;
    text-align: center;
    margin-top: 3px;
  }
}
}
.list{
  height: 70px;
  width: 100%;
  padding: 10px;
  border-bottom: 1px solid rgb(225, 225, 225);
  display: flex;
  .img{
    height: 60px;
    width: 60px;
    border-radius: 50%;
    overflow: hidden;
    img{
      width: 100%;
    }
  }
  .list-right{
    width: 100%;
    height: 70px;
    display: flex;
    margin-left: 20px;
    flex-direction: column;
    .name{
    height: 20px;
    width: 100%;
    line-height: 20px;
    margin-top: 10px;
    font-size: 20px;
  }
  .phone{
    margin-top: 10px;
    height: 20px;
    width: 100%;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    .detail{
      margin-top: -15px;
      margin-right: 10px;
      color: rgb(8, 98, 166);
    }
  }
  }
  
}
}
</style>